﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Irandeb4.Models
{
    public class User
    {
        public int UserId { get; set; }
        public int EmployeeId { get; set; }
        public int UserRoleId { get; set; }

        [Required]
        [Editable(false)]
        [Display(Name = "Nombre usuario")]
        public string UserName { get; set; }

        [Required]
        [Editable(false)]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email Empresa")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "el {0} debe ser de por lo menos {2} caracteres.", MinimumLength = 7)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirmar password")]
        [Compare("Password", ErrorMessage = "El password y la confirmacion del password no coinciden.")]
        public string ConfirmPassword { get; set; }



        public bool Active { get; set; }

        public virtual UserRole UserRole { get; set; }
        
        [ScaffoldColumn(false)]
        public virtual Employee Employee { get; set; }
    }
}